/**
 * Created by UICUT.com on 2016/12/31.
 * Contact QQ: 215611388
 */
jQuery(".js_banner").slide({
  mainCell: ".bd ul",
  autoPlay: true
});
jQuery(".js_bannerLeft").slide({
  mainCell: ".bd ul",
  autoPlay: true,
  effect: "leftLoop"
});
jQuery(".js_slideTxtBox").slide({
  endFun: function endFun(i, c) {
    var str = '.js_slideTxtBox .con' + (i + 1); // console.log(str)

    $(".js_slideTxtBox .bd").height($(str).height());
  }
});
jQuery(".js_picScrollLeft").slide({
  mainCell: ".bd ul",
  autoPage: true,
  effect: "left",
  autoPlay: true,
  vis: 5,
  trigger: "click"
});
$(function () {
  // 通用：弹框关闭
  $(document).on('click', '.alert .btn-close,.alert .over-close,.alert .js_btn-cancle', function (event) {
    event.preventDefault();
    $(this).parents(".alert").fadeOut('300', function () {
      $(this).removeClass('show');
    });
  }); // 验证码发送

  function timeClock(cls) {
    var _this = cls;

    if (_this.hasClass('disabled')) {
      return false;
    } else {
      var clock = function clock() {
        _this.text("重新发送(" + i + ")");

        i--;

        if (i < 0) {
          _this.removeClass('disabled');

          i = 59;

          _this.text("获取验证码");

          clearInterval(_int);
        }
      };

      _this.addClass('disabled');

      var i = 59;

      var _int = setInterval(clock, 1000);

      return false;
    }
  } // 发送验证码


  $("body").on('click', '.btn-yzm', function (event) {
    event.preventDefault();
    timeClock($(this));
  }); // 多选

 

  $("body").on('click', '.demoTest .filter .item', function (event) {
    event.preventDefault();

    if (!$(this).hasClass('on')) {
      $(this).addClass('on').siblings().removeClass('on');
      $('.demoTest .details .con').css({
        display: 'none'
      }).eq($(this).index()).css({
        display: 'block'
      });
    }
  });
});
$(".scroll").niceScroll({
  cursorcolor: "#eee",
  cursorwidth: "8px",
  cursorborder: ""
});
function getUrlParams(url) {
  url = url || location.href;
  url = url.replace("#!/", "");
  if (url.lastIndexOf("?") === -1 || url.lastIndexOf("?") === url.length - 1)
    return {};
  var search = url.split("?")[1].split("&");
  var params = {};
  for (var i in search) {
    if (!!search[i]) {
      var _temp = search[i].split("=");
      params[_temp[0]] = _temp[1];
    }
  }
  return params;
}
